Skip to content

change defaults for Dropout and BatchNorm#5299

Merged
copybara-service[bot] merged 1 commit intomainfrom
test_877557940
Apr 7, 2026
Merged

change defaults for Dropout and BatchNorm#5299
copybara-service[bot] merged 1 commit intomainfrom
test_877557940

Conversation

@copybara-service
Copy link
Copy Markdown

change defaults for Dropout and BatchNorm

Changes Dropout.deterministic and BatchNorm.use_running_average to be None by default, use now has to explicitely provide them by either:

  1. Passing them to the constructor e.g:

self.bn = nnx.BatchNorm(..., use_running_average=False)

  1. Passing them to call:

self.dropout(x, deterministic=False)

  1. Using nnx.view to create a view of the model with specific values:

train_model = nnx.view(model, detereministic=False, use_running_average=False)

@copybara-service copybara-service bot force-pushed the test_877557940 branch 2 times, most recently from 2215186 to 6265b48 Compare March 4, 2026 23:41
Changes `Dropout.deterministic` and `BatchNorm.use_running_average` to be None by default, use now has to explicitely provide them by either:

1. Passing them to the constructor e.g:

  self.bn = nnx.BatchNorm(..., use_running_average=False)

2. Passing them to __call__:

  self.dropout(x, deterministic=False)

3. Using `nnx.view` to create a view of the model with specific values:

  train_model = nnx.view(model, detereministic=False, use_running_average=False)

PiperOrigin-RevId: 896124054
@copybara-service copybara-service bot merged commit 84da828 into main Apr 7, 2026
@copybara-service copybara-service bot deleted the test_877557940 branch April 7, 2026 22:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants